import React from 'react';
import {View} from 'react-native';
import Ionicons from 'react-native-vector-icons/Ionicons';
import InquiryTasks from '../../Pages/Home/InquiryTasks/InquiryTasks';
import OrderTasks from '../../Pages/Home/OrderTasks/OrderTasks';
import Me from '../../Pages/Home/Me/Me';
import {createBottomTabNavigator} from '@react-navigation/bottom-tabs';
const Tab=createBottomTabNavigator();
const TabBarIcon = ({focused, size, color}, route) => {
    let iconName;
    if (route.name === 'inquiryTasks') {
        iconName = 'ios-home';
    } else if (route.name === 'orderTasks') {
        iconName = "ios-list";
    }else{
        iconName="ios-person";
    }
    return <Ionicons name={iconName} size={size} color={color} />;

};
export default function ({navigation}){
    return ( <Tab.Navigator
        screenOptions={({ route }) => ({
            tabBarIcon: ({ focused, color, size }) => {
                let iconName;
                if (route.name === 'inquiryTasks') {
                    iconName = 'ios-home';
                } else if (route.name === 'orderTasks') {
                    iconName = "ios-list";
                }else{
                    iconName="ios-person";
                }
                return <Ionicons name={iconName} size={size} color={color} />;
            }
        })}
        tabBarOptions={{
            activeTintColor: '#1678ff',
            inactiveTintColor: '#666',
        }}
        initialRouteName="inquiryTasks"
        >
        <Tab.Screen name="inquiryTasks" component={InquiryTasks} options={{title:'询价任务'}}/>
        <Tab.Screen name="orderTasks" component={OrderTasks} options={{title:'订单任务'}} />
        <Tab.Screen name="me" component={Me} options={{title:'我的'}} />
    </Tab.Navigator>)
}
// screenOptions={({ route }) => ({
//     tabBarIcon: ({ focused, color, size }) => {
//         let iconName;
//         if (route.name === 'inquiryTasks') {
//             iconName = 'ios-home';
//         } else if (route.name === 'orderTasks') {
//             iconName = "ios-list";
//         }else{
//             iconName="ios-person";
//         }
//         return <Ionicons name={iconName} size={size} color={color} />;
//     },
// })}
// tabBarOptions={{
//     activeTintColor: '#1678ff',
//     inactiveTintColor: '#666',
// }}
